<template>
  <j-modal
    :title="'报表审批'"
    :width="800"
    :visible="visible"
    :maskClosable="false"
    :ok-button-props="{ props: { disabled: disableSubmit } }"
    :fullscreen="true"
    @close="close"
    cancelText="关闭"
  >
    <template slot="footer">
      <a-button key="back" style="padding-left: 20px; padding-right: 20px" @click="close()"> 关闭 </a-button>
      <a-popconfirm title="确定不通过吗?" style="width: 150px" @confirm="() => setApproveReason('2')">
        <a-button key="save" style="padding-left: 8px; padding-right: 8px"> 不通过 </a-button>
      </a-popconfirm>
      <a-popconfirm title="确定通过吗?" style="width: 150px" @confirm="() => setApproveReason('3')">
        <a-button key="submit" type="primary"> 通过 </a-button>
      </a-popconfirm>
    </template>
    <a-spin :spinning="Loading">
      <div :class="{ isCheck: isCheck }">
        <!-- <div class="table-header">
          <span class="table-title">填报单位：</span>{{model.departName}}
          <span class="table-title">审计负责人：</span>{{model.auditPersonName}}
          <span class="table-title">填表人：</span>{{model.createByText}}
          <span class="table-title">填表时间：</span>{{model.createTime}}
          <span class="table-title">统计时间：</span>{{model.year}}年（{{model.quarter}}季度）
          <span class="table-title">说明性文件:</span>
        </div> -->
        <a-table
          class="edit-list"
          ref="table"
          size="middle"
          bordered
          width="100vw"
          rowKey="id"
          :pagination="false"
          :columns="columns"
          :dataSource="dataSource"
          :scroll="{ x: 250, y: 520 }"
        >
          <div slot="title">
            <div class="title">{{ title }}</div>
            <div class="sub-title">
              <div>填报单位：{{ model.departName }}</div>
              <div>{{ model.year }}年（{{ model.quarter }}季）度</div>
              <div>审计负责人：{{ model.auditPersonName }}</div>
              <div>填表人：{{ model.createByText }}</div>
              <div>填表时间：{{ model.createTime }}</div>
              <div>金额单位（万元）</div>
            </div>
          </div>
          <template slot="name" slot-scope="name">
            <div style="width: 100%; height: 45px; overflow-x: hidden; overflow-y: auto">{{ name }}</div>
          </template>
        </a-table>
        <FileTag :apiId="model.fileId"></FileTag>
      </div>
    </a-spin>

    <SetReason ref="setReason" @approveData="approveData2"></SetReason>
  </j-modal>
</template>
<script>
import columns from './columns4'
import SetReason from '../SetReason'
import FileTag from '../../../components/FileTag'
import { BbspModelMixin } from './BbspModelMixin'
export default {
  name: 'CheckAndEditModel',
  mixins: [BbspModelMixin],
  components: {
    SetReason,
    FileTag,
  },
  data() {
    return {
      model: {},
      columns: columns(this),
      reportType: '',
      sjType: '2',
      approveType: '3',
      url: {
        list: '/sjxxzhbb/sjAuditInfo/getAuditInfoDetails',
        approve: '/common/sjProcCommon/auditApply',
      },
    }
  },
  created() {},
  methods: {
    // 审批
    approve(record) {
      this.Loading = true
      this.model = Object.assign({}, record)
      this.visible = true
      this.getTableData2()
    },
  },
}
</script>

<style lang="less" scoped>
// @import '../../../css/checkAndEdit.less';
@import '../../css/baobiaotable.less';

.table-header {
  margin-bottom: 10px;

  .table-title {
    font-weight: bold;
    margin-left: 15px;
  }
}
</style>
